package com.zhao;

import com.zhao.concreteAggregate.UserAggregateImpl;
import com.zhao.iterator.UserIterator;

public class Client {
    public static void main(String[] args) {
        UserAggregateImpl userAggregate = new UserAggregateImpl();

        userAggregate.addUser(new User("1", "张三"));
        userAggregate.addUser(new User("2", "李四"));
        userAggregate.addUser(new User("3", "王五"));
        userAggregate.addUser(new User("4", "朱六"));

        UserIterator userIterator = userAggregate.getUserIterator();

        while (userIterator.hasNext()) {
            System.out.println(userIterator.next());
        }
    }
}
